package org.zhadoop.stream.cql.semanticanalyzer.parser.context;

import java.util.List;

import org.zhadoop.stream.cql.exception.SemanticAnalyzerException;
import org.zhadoop.stream.cql.semanticanalyzer.analyzecontext.expressiondesc.ExpressionDescribe;
import org.zhadoop.stream.cql.semanticanalyzer.parsecontextreplacer.ParseContextReplacer;
import org.zhadoop.stream.cql.semanticanalyzer.parsecontextwalker.ParseContextWalker;

import com.google.common.collect.Lists;

/**
 * 算术乘法运算解析内容
 * 
 * @author zwd
 *
 */
public class ArithmeticStarExpressionContext extends BaseExpressionParseContext {

	private List<String> operator;

	// FieldExpressionContext
	private List<BaseExpressionParseContext> fieldExpressions;

	public ArithmeticStarExpressionContext() {
		operator = Lists.newArrayList();
		fieldExpressions = Lists.newArrayList();
	}

	@Override
	public void walkChildAndReplace(ParseContextReplacer replacer) {
		// TODO Auto-generated method stub

	}

	@Override
	protected ExpressionDescribe createExpressionDesc() throws SemanticAnalyzerException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(fieldExpressions.get(0));
		for (int i = 0; i < operator.size(); i++) {
			sb.append(" " + operator.get(i) + " ").append(fieldExpressions.get(i + 1));
		}
		return sb.toString();
	}

	@Override
	protected void walkChild(ParseContextWalker walker) {
		// TODO Auto-generated method stub

	}

	public List<String> getOperator() {
		return operator;
	}

	public void setOperator(List<String> operator) {
		this.operator = operator;
	}

	public List<BaseExpressionParseContext> getFieldExpressions() {
		return fieldExpressions;
	}

	public void setFieldExpressions(List<BaseExpressionParseContext> fieldExpressions) {
		this.fieldExpressions = fieldExpressions;
	}
	

}
